#ifndef __EVENTRPC_RPCEVENT_H__
#define __EVENTRPC_RPCEVENT_H__

#include <google/protobuf/service.h>
#include "base.h"
#include "eventi.h"
#include "rpcchannel.h"

namespace eventrpc {
  class RpcClientEvent
    : public Event
      , public gpb::RpcChannel {
        //, public RpcChannel {
       public:
        RpcClientEvent(const char *ip, int port);

        virtual ~RpcClientEvent();

        virtual int OnWrite();

        virtual int OnRead();

        virtual void CallMethod(const gpb::MethodDescriptor* method,
                                gpb::RpcController* controller,
                                const gpb::Message* request,
                                gpb::Message* response,
                                gpb::Closure* done);

       private:
        struct Impl;
        Impl *impl_;
      };
};

#endif  //  __EVENTRPC_RPCEVENT_H__
